import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import router from "./router"
import request from './plugins/request'

Vue.config.productionTip = false

Vue.use(ElementUI);
import 'windi.css'

Vue.prototype.request = request

Vue.filter('dateFormat', function (originVal) {
  const dt = new Date(originVal);
 
  //获取年份
  const y = dt.getFullYear();
  //获取月份，月份是从0开始，需要+1，先＋1转换成字符串，调用字符串的padStart方法，保证位数为2，不足补0
  const m = (dt.getMonth() + 1 + '').padStart(2, '0');
  const d = (dt.getDate() + '').padStart(2, '0');
 
  const hh = (dt.getHours() + '').padStart(2, '0');
  const mm = (dt.getMinutes() + '').padStart(2, '0');
  const ss = (dt.getSeconds() + '').padStart(2, '0');
 
  return `${y}-${m}-${d} ${hh}-${mm}-${ss}`;
})

new Vue({
  render: h => h(App),
  router
}).$mount('#app')
